#include "CommDefs.h"

DWORD RetNumberOfInterface()
{
	DWORD	retVal = 0;
	HMODULE hMod = LoadLibrary(L"Iphlpapi.dll");
	getNumInterfaceFun	p_Functor = (getNumInterfaceFun) GetProcAddress(hMod,"GetNumberOfInterfaces");

	p_Functor(&retVal);

	FreeLibrary(hMod);
	return retVal;
}

void RetrieveAddresses(PIP_ADAPTER_INFO pAdapterInfo,ULONG	ulNumberOfInterfaces)
{
	HMODULE hMod = LoadLibrary(L"Iphlpapi.dll");
	ULONG	size = ulNumberOfInterfaces*sizeof(IP_ADAPTER_INFO);
	GetAdaptersInfoFunction	p_Functor = (GetAdaptersInfoFunction) GetProcAddress(hMod,"GetAdaptersInfo");
	p_Functor(pAdapterInfo,&size);
	FreeLibrary(hMod);
}